class baseconfig(object):
	CSRF_ENABLED = True
	SECRET_KEY = '123456'
	# mail
	MAIL_SERVER = 'smtp.sina.com'
	MAIL_PROT = 25
	MAIL_USE_TLS = True
	MAIL_USE_SSL = False
	MAIL_USERNAME = "taojun319@sina.com"
	MAIL_PASSWORD = "123.com"
	# MAIL_DEBUG = True
	MAIL_DEFAULT_SENDER = 'taojun319@sina.com'
#
	@staticmethod
	def init_app(app):
		pass


class developconfig(baseconfig):
	DEBUG = True
	# db
	# SQLALCHEMY_DATABASE_URI = 'mysql://flask:123456@192.168.31.185/flask_project'
	# SQLALCHEMY_POOL_TIMEOUT = 10
	# SQLALCHEMY_TRACK_MODIFICATIONS = False
	# SQLALCHEMY_COMMIT_ON_TEARDOWN = True
	import os
	# basedir= os.path.abspath(os.path.dirname(__file__))
	# SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,'data.sqlit')

	basedir = os.path.abspath(os.path.dirname(__file__))
	alarms_dbname = "alarms"
	db_username = "falcon"
	db_password = "123456"
	db_ip = "192.168.31.230"

	SQLALCHEMY_DATABASE_URI = 'mysql://%s:%s@%s/%s' %(db_username, db_password, db_ip, alarms_dbname)
	SQLALCHEMY_MAX_OVERFLOW = 50
	SQLALCHEMY_ECHO = False
	SQLALCHEMY_POOL_SIZE = 20
	SQLALCHEMY_TRACK_MODIFICATIONS = False
	SQLALCHEMY_COMMIT_ON_TEARDOWN = True


class portal(baseconfig):
	# db
	SQLALCHEMY_DATABASE_URI = 'mysql://flask:123456@192.168.31.185/flask_portal'
	SQLALCHEMY_POOL_TIMEOUT = 10
	SQLALCHEMY_TRACK_MODIFICATIONS = False
	SQLALCHEMY_COMMIT_ON_TEARDOWN = True

import os
logdir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'log')
logfile = 'flask.log'
config = {'default': developconfig, 'portal': portal, 'develop': developconfig}